import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:文件操作和io
 * User: bjc
 * Date: 2025-10-23
 * Time: 15:29
 */
public class IoDemo01 {
    public static void main(String[] args) throws IOException, InterruptedException {
        File file = new File("./text.txt");
        System.out.println(file.getParent());
        System.out.println(file.getName());
        System.out.println(file.exists());
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());
        boolean newFile = file.createNewFile();
        System.out.println(newFile);
        file.deleteOnExit();
        Thread.sleep(5000);
    }
}
